package com.foreknow.demo4;

/**
 * @author shkstart
 * @create 2021-07-26 15:11
 */
public abstract class Pet {
    private String name;
    private int health;
    private int love;

    public Pet() {
    }

    public Pet(String name, int health, int love) {
        this.name = name;
        this.health = health;
        this.love = love;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    @Override
    public String toString() {
        return "Pet{" +
                "name='" + name + '\'' +
                ", health=" + health +
                ", love=" + love +
                '}';
    }
    //抽象方法只有方法的声明没有实现
    //一类中只要有一个抽象方法，那么这个类一定要声明为抽象类
    public abstract void toHospital();

    public abstract void eat();

}
